<template>
	<div>
		<detail-banner 
		v-bind:sightName = "sightName"
		v-bind:bannerImg = "bannerImg"
		v-bind:gallaryImgs = "gallaryImgs"
		></detail-banner>
		<detail-header></detail-header>		
		<div class="content">
			<detail-list :list="list"></detail-list>
		</div>
	</div>
	
</template>

<script>
	import DetailBanner from './components/banner'
	import DetailHeader from './components/header'
	import DetailList from './components/list'
	import axios from 'axios'
	export default {
		name:"Detail",
		components:{
			DetailBanner,
			DetailHeader,
			DetailList
		},
		data:function(){
			return{
				sightName:"",
				bannerImg:"",
				gallaryImgs:[],
				list:[]				
			}
		},
		methods:{
			getDetailInfo:function(){
				axios.get('/api/detail.json',{
					params:{
						id:this.$route.params.id
					}
				}).then(this.handleDetailSucc)
			},
			handleDetailSucc:function(data){
				data = data.data				
				 if(data.ret && data.data){
					var res = data.data
					console.log(res)
					this.sightName = res.sightName
					this.bannerImg = res.bannerImg
					this.gallaryImgs = res.gallaryImgs
					this.list = res.categoryList
				 }
			}
		},
		mounted:function(){
			this.getDetailInfo()			
		}
// 		activated:function(){
// 			this.getDetailInfo()
// 		}
	}
</script>
<style lang="stylus" scoped>
</style>